package com.ruoyi.front_desk.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.front_desk.Mapper.FrontdeskNameCategoryMapper;
import com.ruoyi.front_desk.Result;
import com.ruoyi.front_desk.articles.domain.FrontdeskArticles;
import com.ruoyi.front_desk.articles.mapper.FrontdeskArticlesMapper;
import com.ruoyi.front_desk.articles.service.FrontdeskArticlesService;
import com.ruoyi.front_desk.service.FrontdeskNameCategoryService;
import lombok.val;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import java.util.List;
/**
 * @author 刘奥旸
 * @version 1.0
 */
//@PermitAll
@RestController
public class FrontdeskArticlescontroller extends BaseController {
    @Resource
    FrontdeskArticlesService frontdeskArticlesService;
    @Resource
    FrontdeskArticlesMapper frontdeskArticlesMapper;
   @GetMapping(value = "/articles")
    public Result navigation(@RequestParam Long id){
       FrontdeskArticles frontdeskArticles = frontdeskArticlesService.selectFrontdeskArticlesByIdService(id);
       return Result.success(frontdeskArticles);
   }

   //根据id返回artiles的内容。
   @GetMapping(value = "/articlenames")
   public TableDataInfo fff(@RequestParam Integer id) {
       val frontdeskArticles = frontdeskArticlesService.selectFrontdeskArtilesmuti(id);
       return getDataTable(frontdeskArticles);
   }
   //首页渲染文
    @GetMapping(value = "/home/zeigen")
    public FrontdeskArticles q1() {
        FrontdeskArticles frontdeskArticles = frontdeskArticlesMapper.selectFrontdeskArticlesall();
        return frontdeskArticles;
    }
    //自增
//    @GetMapping(value = "/layh")
//    public Integer q2() {
//        Integer integer = frontdeskArticlesMapper.updateFrontdeskArticle(7L);
//        return integer;
//    }
}
